<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<script>
function site_sub(id){
	$('#'+id).form('submit',{
		url: "<?php echo base_url()?>systemmanage/settingssite",
		onSubmit: function(){
			//alert($(this).form('validate'));
			return $(this).form('enableValidation').form('validate');
		},
		success: function(result){
			var result = eval('('+result+')');
			if(result.success == true){
				$.messager.alert('提示','修改成功，重新登录后生效!','info');
				//$(".main").empty().load("<?php echo base_url()?>systemmanage/settingssite");
			}else{
				$.messager.alert('警告',result.errorMsg,'warning');	
			}
		}
	});
}
</script>
<div class="easyui-tabs" data-options="fit:true,border:false,plain:true">
    <div title="基本设置" style="padding:10px">
    	<!--基本设置!-->
        <form id="basicfm" method="post">
        <table cellpadding="5" style="width:100%;">
            <tr>
                <th align="right" style="width:100px;"> 系统名称：</th>
              <td><input class="easyui-textbox" data-options="required:true" style="width:60%;" name='site_name'  value="<?php echo $site->site_name; ?>" /></td>
            </tr>
            <tr>
                <th align="right">系统网址：</th>
              <td><input class="easyui-textbox" style="width:60%;" name='site_domain'  value="<?php echo $site->site_domain; ?>" /></td>
            </tr>
            <tr>
                <th align="right"> 系统ogo：</th>
              <td><input class="easyui-textbox" style="width:60%;" name='site_logo' value="<?php echo $site->site_logo; ?>" /></td>
            </tr>
            <tr>
                <th align="right">备案号：</th>
              <td><input class="easyui-textbox" style="width:60%;" name='site_icp' value="<?php echo $site->site_icp; ?>" /></td>
            </tr>           
            <tr>
            	<td colspan="2"><div class="menu-sep" style="margin: 3px 0px 3px 3px;"></div></td>
            </tr>
            <tr>
                <td colspan="2"><a href="#" onclick="site_sub('basicfm')" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存基本设置</a></td>
            </tr>
        </table>
        </form>
    </div>
    <div title="系统状态" style="padding:5px">
    	<form id="statusfm" method="post">
        <table cellpadding="5" style="width:100%;">
            <thead>
                <tr>
					<th style="width:100px;">系统状态：</th>
					<td>
                    	<input type="radio" style="width:40px;" name="site_status" value="1" <?php echo $site->site_status == 1 ? 'checked="checked"' : ''; ?>>开启
                        <input type="radio" style="width:40px;" name="site_status" value="0" <?php echo $site->site_status == 0 ? 'checked="checked"' : ''; ?>>关闭
                    </td>
				</tr>
				<tr>
					<th>关闭原因：</th>
					<td><input class="easyui-textbox" data-options="multiline:true" name='site_close_reason' id="site_close_reason" value="<?php echo $site->site_close_reason; ?>" style="height:50px;width:90%"></td>
				</tr>
                <tr>
                    <td colspan="2"><div class="menu-sep" style="margin: 3px 0px 3px 3px;"></div></td>
                </tr>
				<tr>
					<td colspan="2"><a href="#" onclick="site_sub('statusfm')" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存站点状态</a></td>
				</tr>
            </thead>
        </table>
        </form>
    </div>
    <div title="附件设置" style="padding:5px">
    	<!--附件设置!-->
        <form id="attachmentfm" method="post">
        <table cellpadding="5" style="width:100%;">
            <tr>
                <th style="width:100px;">上传类型：</th>
                <td><input class="easyui-textbox" name='attachment_type' data-options="multiline:true,required:true" value="<?php echo $site->attachment_type; ?>" style=" width:500px;height:100px" /></td>
            </tr>
            <tr>
                <th>上传大小限制：</th>
                <td><input class="easyui-numberbox" name='attachment_maxupload' value="<?php echo $site->attachment_maxupload; ?>" data-options="min:1,max:500,required:true" missingMessage="不大于500M"/> 单位：M（兆）</td>
            </tr>
            <tr>
                <td colspan="2"><div class="menu-sep" style="margin: 3px 0px 3px 3px;"></div></td>
            </tr>
            <tr>
                <td colspan="2"><a href="#" onclick="site_sub('attachmentfm')" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存附件设置</a></td>
            </tr>            
        </table>
        </form>
    </div>
    <div title="客户端设置" style="padding:5px">
    	<!--附件设置!-->
        <form id="clientfm" method="post">
        <table cellpadding="5" style="width:100%;">           
            <tr>
                <th style="width:100px;">版本号：</th>
                <td><input name='client_verCode' value="<?php echo $site->client_verCode; ?>" class="easyui-numberbox" data-options="min:1,max:99,required:true" missingMessage="输入数字 1-99"/></td>
            </tr>
            <tr>
                <td colspan="2"><div class="menu-sep" style="margin: 3px 0px 3px 3px;"></div></td>
            </tr>
            <tr>
                <td colspan="2"><a href="#" onclick="site_sub('clientfm')" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存附件设置</a></td>
            </tr>            
        </table>
        </form>
    </div>
</div>